home *** CD-ROM | disk | FTP | other *** search
/ Freelog 46 / Freelog046.iso / Alu / Celestia / Win32LoresTex / celestia-lores-win32-1.3.0.exe / {app} / shaders / shadowtex.vp < prev    next >
Text File  |  2003-02-19  |  879b  |  31 lines

  1. !!VP1.0
  2.  
  3. # Vertex program use for applying shadow textures.  2D texture coordinates
  4. # are generated from vertex coordinates using the s and t texture planes
  5. # in constants c[41] and c[42].
  6. #
  7. # c[0]..c[3] contains the concatenation of the modelview and projection
  8. # matrices.
  9. # c[20] contains the color
  10. # c[41]..c[42] contain the texture transformation
  11. # c[16] contains the light direction; used to compute texture coordinates
  12. #    for a 'shadow mask' texture used to prevent shadows from appearing on
  13. #    the wrong side of an object.
  14.  
  15. # Transform the vertex by the modelview matrix
  16. DP4   o[HPOS].x, c[0], v[OPOS];
  17. DP4   o[HPOS].y, c[1], v[OPOS];
  18. DP4   o[HPOS].z, c[2], v[OPOS];
  19. DP4   o[HPOS].w, c[3], v[OPOS];
  20.  
  21. # Generate texture coordinates
  22. DP4   o[TEX0].x, c[41], v[OPOS];
  23. DP4   o[TEX0].y, c[42], v[OPOS];
  24.  
  25. DP4   o[TEX1].x, c[16], v[OPOS];
  26.  
  27. # Color
  28. MOV   o[COL0], c[20];
  29.  
  30. END
  31.